#include"CommAlg.h"

#if !defined(FLT_DEC)
#define FLT_DEC    0.000001f
#endif

long F2I_DEC(float fv){
	if (fv > 0)return ((long)(fv + FLT_DEC));
	return ((long)(fv - FLT_DEC));
}

long ROUND_DEC(float fv)
{
	long rv = 0;
	fv > 0 ?  rv = F2I_DEC(fv + 0.5F) : rv = F2I_DEC(fv - 0.5F);
	return rv;
}

BEGIN_ALG

float __abs(float v){return (float)fabs(v);}
double __abs(double v){return fabs(v);}
int __abs(int v){return abs(v);}

END_ALG
